home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / Tools / Grafik / Misc / ImageEnginer / ARexx / FitSelectAlpha.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1999-09-18  |  2.2 KB  |  84 lines

  1. /*********************************/
  2. /* Image Engineer Macro script   */
  3. /* by Simon Edwards              */
  4. /* 3/4/95                        */
  5. /*                               */
  6. /* 18/1/97 FORM interface added  */
  7. /*                               */
  8. /* MS: Alpha now uses            */
  9. /*     zoomlevel of orig image   */
  10. /*                               */
  11. /* This lets you select an alpha */
  12. /* channel image to be scaled to */
  13. /* the same as the project.      */
  14. /*********************************/
  15.  
  16. address IMAGEENGINEER
  17.  
  18. Options results
  19. signal on error         /* Setup a place for errors to go */
  20.  
  21. if arg()==0 then exit
  22. pic=arg(1)
  23.  
  24. PROJECT_INFO pic WIDTH
  25. picwidth=result
  26. PROJECT_INFO pic HEIGHT
  27. picheight=result
  28. PROJECT_INFO pic ZOOM
  29. origzoomval=result
  30.  
  31.  
  32. 'FORM "Select Alpha Image" "Ok|Cancel"',
  33. ' RADIO,"Image","Spherical|Spherical2|Horizontal Gradient|Vertical Gradient|Highlight|Highlight2",0'
  34.  
  35. parse var result ok reply .
  36.  
  37. if reply==0 then alphaname='IE:alpha/Spherical.alpha'
  38. if reply==1 then alphaname='IE:alpha/Spherical2.alpha'
  39. if reply==2 then alphaname='IE:alpha/Gradient.alpha'
  40. if reply==3 then alphaname='IE:alpha/Gradient.alpha'
  41. if reply==4 then alphaname='IE:alpha/highlight.alpha'
  42. if reply==5 then alphaname='IE:alpha/highlight2.alpha'
  43.  
  44. 'OPEN "'||alphaname||'" 8BIT'
  45. alphachannel=result
  46.  
  47. PROJECT_SET alphachannel ZOOM origzoomval
  48.  
  49.  
  50. if reply==4 then do
  51.   'ROTATE' alphachannel '90 FAST'
  52.   newalpha=RESULT
  53.   CLOSE alphachannel
  54.   alphachannel=newalpha
  55. end
  56.  
  57. SCALE alphachannel picwidth picheight BEST
  58. newalpha=result
  59. CLOSE alphachannel
  60.  
  61. MARK pic PRIMARY
  62. MARK newalpha ALPHA
  63.  
  64. exit
  65.  
  66.  
  67. /*******************************************************************/
  68. /* This is where control goes when an error code is returned by IE */
  69. /* It puts up a message saying what happened and on which line     */
  70. /*******************************************************************/
  71. error:
  72. if RC=5 then do         /* Did the user just cancel us? */
  73.     IE_TO_FRONT
  74.     LAST_ERROR
  75.     'REQUEST "'||RESULT||'"'
  76.     exit
  77. end
  78. else do
  79.     IE_TO_FRONT
  80.     LAST_ERROR
  81.     'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'
  82.     exit
  83. end
  84.